import React from "react";
import Modal from "../Modal";
import Button from "../Button";
import { WarnIcon } from "../Svg";
import "./style/index";

export interface Props {
  visible?: boolean;
  content?: string;
  onOk?: (...args: any[]) => any;
  onCancel?: (...args: any[]) => any;
}

function DeleteModal(props: Props) {
  const { visible, content } = props;
  const modalProps = {
    visible,
    className: "delete-modal",
    title: "提示",
    width: 420,
    footer: [
      <Button onClick={props.onCancel}>取消</Button>,
      <Button danger type="primary" onClick={props.onOk}>
        确认
      </Button>,
    ],
    onOk: props.onOk,
    onCancel: props.onCancel,
  };
  return (
    <Modal {...modalProps}>
      <div className="modals-body">
        <WarnIcon />
        <span className="modals-content">{content}</span>
      </div>
    </Modal>
  );
}

export default DeleteModal;
